#ifndef __HERM_UTILS_CONFIG_FILE_H__
#define __HERM_UTILS_CONFIG_FILE_H__

#include <string>
#include <fstream>
#include <map>
#include <vector>
#include "herm/export_symbols.h"
#include "exception.h"

namespace herm{

/**
 * @brief ConfigFile&ConfigFileException.
 */
#define HERM_CONFIG_FILE_EXCEPTION(desc) \
	herm::ConfigFileException(__FILE__, __LINE__, __FUNCTION__, desc)

class HERM_API ConfigFileException : public Exception
{
public:
	ConfigFileException(const std::string& file, int line, const std::string& func, const std::string desc);
};

class HERM_API ConfigFile
{
public:
    ConfigFile(const std::string& fileName, bool isPath = false);

    std::string GetStrValue(const std::string& name) const;
    unsigned int GetIntValue(const std::string& name) const;

	void SetStrValue(const std::string& name, const std::string& val);
	void SetIntValue(const std::string& name, int val);
	void Save();
private:
    typedef std::map<std::string, std::string> Name2Values;
    Name2Values m_name2Vals;
	std::string m_path;
};
}

#endif
